import logging,yagmail
from BeautifulReport import BeautifulReport
class Tools():
    def Log(self):
        logging.basicConfig(level=logging.DEBUG,
                            format='%(levelname)s -> %(asctime)s -> %(filename)s -> %(message)s %(lineno)d',
                            filename='must.log',
                            filemode='w+')
    def baogao(self,suite):
        BeautifulReport(suite).report(filename='mucic.html',description='测试报告')
    def send_email(self,filename):
        send=yagmail.SMTP(user='505624919@qq.com',password='vpngefkrihnkbgbf',host='smtp.qq.com')
        send.send(to='505624919@qq.com',subject='测试报告',contents='报告',attachments=filename)
        send.close()